from celery_tasks.yuntongxun.ccp_sms import CCP
from celery_tasks.main import celery_app

@celery_app.task(bind=True,name='send_sms_code',retry_backoff=3)
#定义任务,发送短信验证码
def send_sms_code(self,mobile,sms_code):
    try:
        res = CCP().send_message(1,mobile,(sms_code,5))
    except Exception as e:
        raise self.retry(exec=e,max_retries=3)
    return res